<?php

use Jialeo\LaravelSchemaExtend\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /*
     * database init
     *
     * CREATE DATABASE IF NOT EXISTS `KSKD` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
     */

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->charset = 'utf8';
            $table->collation = 'utf8_general_ci';
            $table->comment = '用户表';
            $table->increments('id')->comment('主键');
            $table->char('phone_num',11)->default('')->unique()->comment('手机');
            $table->string('password')->default('')->commnet('密码');
            $table->string('avatar')->default('')->comment('用户头像');
            $table->string('nfsp_user_id')->nullable()->comment('新流用户id');
            $table->unsignedInteger('using_bank_card')->nullable()->comment('用户当前使用的银行卡');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
